<?php echo $this->fetch('header.html'); ?>
<style>
.kdorder_add {background:#f1f1f1;}
.kdorder_add td{padding:6px; background:#FFF; line-height:22px;}
.kdorder_add th {font-size:13px; color:#333; background:#f0f7ff; width:150px; font-weight:normal;text-align:right; padding-right:5px;}
.kdorder_add th em {font-style:normal; color:#F00; margin-right:8px}
.kdorder_add .select_class {border: 1px #d1d1d1 solid;height: 30px;border-radius:2px;width:50%}
.inputBorder{border: 1px #d1d1d1 solid;height: 20px;line-height: 20px;padding:4px 4px; width:50%}
.botton_submit {border:0;background:#ed5736;height:31px;width:100px;text-align:center;line-height:31px;font-family:"Microsoft YaHei";font-size:14px;color:#fff;cursor:pointer;border-radius:4px; margin-right:10px}
</style>
<div id="rightTop">
  <ul class="subnav">
    <li><a class="btn1" href="index.php?app=kd_express">快递单号</a></li>
    <li><a class="btn0" href="index.php?app=kd_express&act=add">添加单号</a></li>
  </ul>
</div>
<?php if ($_GET['act'] == 'import'): ?>
<form method="post" enctype="multipart/form-data">
<table width="100%" cellspacing="1" class="kdorder_add">
  <tr><td colspan="2" style="padding:12px 8px;background:#ffffe5">导入功能：此功能只做国内快递单号导入之用，对于各快递公司名称和代码请<a href="http://www.ickd.cn/api/list.html" target="_blank">点此查询</a>。</td></tr>
  <tr>
    <th><em>*</em>选择文件：</th>
    <td><input type="file" name="file" id="file" />&nbsp;&nbsp;&nbsp;&nbsp;<font color="#999999">如果导入速度较慢，建议您把文件拆分为几个小文件，然后分别导入</font></td>
  </tr>  
  <tr>
    <th>文件编码：</th>
    <td><label><input type="radio" name="charset" value="gbk" checked="checked" />gbk</label>&nbsp;&nbsp;
        <label><input type="radio" name="charset" value="utf-8" />utf-8</label>&nbsp;&nbsp;
        <label><input type="radio" name="charset" value="big5" />big5</label></td>
  </tr>
  <tr>
    <th>示例模板：</th>
    <td><a href="/data/files/mall/application/express.csv" target="_blank">右键另存为</a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#999999">重要提示：请使用csv格式保存，表格中的字段名称需要填写正确，导入才不会出错。</font></td>
  </tr>
  <tr>
    <th>状态：</th>
    <td>
    <select name="status" id="status" class="select_class">
    <option value="0" <?php if ($this->_var['info']['status'] == '0'): ?>selected="selected"<?php endif; ?>>未使用</option>
    <option value="1" <?php if ($this->_var['info']['status'] == '1'): ?>selected="selected"<?php endif; ?>>已使用</option>
    </select>    
    </td>
  </tr>   
  <tr>
    <th>&nbsp;</th>
    <td>
    <input type="submit" class="botton_submit" value="确认导入"/>
    <input type="hidden" name="act"  value="import"/>
    </td>
 </tr>
</table>
</form>
<?php else: ?>
<form action="" method="post" id="form_box">
<table width="100%" cellspacing="1" class="kdorder_add">
  <tr>
    <td colspan="2" style="padding:12px 8px;background:#ffffe5">提示：添加修改每一次只能操作一个快递单号，如果想要批量导入，请使用<a href="index.php?app=kd_express&amp;act=import" style="color:#00F">导入功能</a>。</td></tr>
  <tr>
    <th><em>*</em>快递单号：</th>
    <td><input type="input" class="inputBorder" name="danhao" id="danhao" value="<?php echo $this->_var['info']['danhao']; ?>" placeholder="请输入快递单号"/></td>
  </tr>  
  <tr>
    <th><em>*</em>快递公司名称：</th>
    <td><input type="input" class="inputBorder" name="CompanyName" id="CompanyName" value="<?php echo $this->_var['info']['CompanyName']; ?>" placeholder="请输入快递公司名称"/></td>
  </tr>
  <tr>
    <th>快递公司代码：</th>
    <td><input type="input" class="inputBorder" name="CompanyCode" id="CompanyCode"  value="<?php echo $this->_var['info']['CompanyCode']; ?>" placeholder="请输入快递公司代码"/></td>
  </tr>   
  <tr>
    <th valign="top" style="padding-top:8px">备注：</th>
    <td><textarea name="notes" id="notes" class="inputBorder" style="height:50px;" placeholder="请输入备注说明"><?php echo $this->_var['info']['notes']; ?></textarea></td>
  </tr>
  <tr>
    <th>状态：</th>
    <td>
    <select name="status" id="status" class="select_class">
    <option value="0" <?php if ($this->_var['info']['status'] == '0'): ?>selected="selected"<?php endif; ?>>未使用</option>
    <option value="1" <?php if ($this->_var['info']['status'] == '1'): ?>selected="selected"<?php endif; ?>>已使用</option>
    </select>    
    </td>
  </tr>   
  <tr>
    <th>&nbsp;</th>
    <td>
    <input type="button" name="imgButton" class="botton_submit" value="确认提交" onclick="return Check_form();" />
    <input type="button" class="botton_submit" value="返回上一页" style="background:#999" onclick="javascript:history.back();"/>
    <?php if ($this->_var['info']['ex_id']): ?>
    <input type="hidden" name="ex_id"  value="<?php echo $this->_var['order_info']['ex_id']; ?>"/><input type="hidden" name="act"  value="edit"/>
    <?php else: ?>
    <input type="hidden" name="act"  value="add"/>
    <?php endif; ?>
    </td>
 </tr>
</table>
</form>
<script type="text/javascript">
//sumbit form
function Check_form() {
  if ($("#danhao").val() == "") {alert("请输入：快递单号");$("#danhao").focus(); return false;}
  if ($("#CompanyName").val() == "") {alert("请输入：快递公司名称");$("#CompanyName").focus(); return false;}
  if ($("#CompanyCode").val() == "") {alert("请输入：快递公司代码");$("#CompanyCode").focus(); return false;}
  $("#form_box").submit();
}
</script>
<?php endif; ?>
<?php echo $this->fetch('footer.html'); ?>